/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mx.itsc.ds2.Dao;

import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import mx.itsc.ds2.model.Assignscholarship;

/**
 *
 * @author Martinez
 */
@Stateless
public class AssignscholarshipDao extends AbstractDao<Assignscholarship> implements AssignscholarshipDaoLocal {
    @PersistenceContext(unitName = "MusicSchoolStudentControl-ejbPU")
    private EntityManager em;

    @Override
    protected EntityManager getEntityManager() {
        return em;
    }

    public AssignscholarshipDao() {
        super(Assignscholarship.class);
    }

    @Override
    public List<Assignscholarship> findByAssignedScholarsipId(Assignscholarship assignedScholarship) {
        Query q =em.createNamedQuery("Assignscholarship.findById");
        q.setParameter("id", assignedScholarship.getId());
        return q.getResultList();
    }
 
    
}
